<?xml version="1.0" ?>
<xs:schema 
	targetNamespace="http://schemas.icitadel.com/Lazarus/Compiled.xsd" 
	elementFormDefault="qualified"
	xmlns="http://schemas.icitadel.com/Lazarus/Compiled.xsd"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:vs="http://schemas.microsoft.com/Visual-Studio-Intellisense" 
	vs:friendlyname="FAI Reuse Controls"
	vs:ishtmlschema="false" 
	vs:iscasesensitive="false" 
	vs:requireattributequotes="false">
   <xs:simpleType name="IndexTypes">
      <xs:restriction base="xs:string">
         <xs:enumeration value="foreign" />
         <xs:enumeration value="unique" />
         <xs:enumeration value="primary" />
         <xs:enumeration value="clustered" />
      </xs:restriction>
   </xs:simpleType>
   <xs:simpleType name="MethodTypes">
      <xs:restriction base="xs:string">
         <xs:enumeration value="Create" />
         <xs:enumeration value="Update" />
         <xs:enumeration value="Get" />
         <xs:enumeration value="List" />
      </xs:restriction>
   </xs:simpleType>
   <xs:simpleType name="Description">
		<xs:restriction base="xs:string" />
   </xs:simpleType>
	<xs:complexType name="IndexCollection">
		<xs:sequence>
			<xs:element name="index" type="Index" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>
   <xs:complexType name="Index">
      <xs:choice minOccurs="0" maxOccurs="1">
         <xs:element name="description" type="Description" />
      </xs:choice>
      <xs:attribute name="type" type="IndexTypes" use="required" />
      <xs:attribute name="object" type="xs:string" />
      <xs:attribute name="accessor" type="xs:string" />
      <xs:attribute name="alias" type="xs:string" />
      <xs:attribute name="filegroup" type="xs:string" />
   </xs:complexType>
   <xs:complexType name="Field">
      <xs:all>
         <xs:element name="description" type="Description" minOccurs="0" maxOccurs="1" />
         <xs:element name="indexes" type="IndexCollection" minOccurs="0" maxOccurs="1" />
      </xs:all>
      <xs:attribute name="name" type="xs:string" use="required" />
      <xs:attribute name="alias" type="xs:string" />
      <xs:attribute name="size" type="xs:integer" />
      <xs:attribute name="scale" type="xs:integer" />
      <xs:attribute name="type" type="xs:string" />
      <xs:attribute name="autogenerate" type="xs:boolean" default="false" />
      <xs:attribute name="required" type="xs:boolean" default="false" />
      <xs:attribute name="readonly" type="xs:boolean" default="false" />
      <xs:attribute name="tableonly" type="xs:boolean" default="false" />
      <xs:attribute name="friendly-name" type="xs:string" />
      <xs:attribute name="logical-name" type="xs:string" />
      <xs:attribute name="dbname" type="xs:string" />
      <xs:attribute name="dbtype" type="xs:string" />
      <xs:attribute name="default" type="xs:string" />
   </xs:complexType>
   <xs:complexType name="FieldCollection">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
         <xs:element name="field" type="Field" />
      </xs:choice>
   </xs:complexType>
   <xs:complexType name="MethodFilter">
		<xs:attribute name="field" type="xs:string" />
		<xs:attribute name="param" type="xs:string" />
   </xs:complexType>
   <xs:complexType name="MethodFilterCollection">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
         <xs:element name="method-filter" type="MethodFilter" />
      </xs:choice>
   </xs:complexType>
   <xs:complexType name="MethodResult">
		<xs:attribute name="object" type="xs:string" />
		<xs:attribute name="field" type="xs:string" />
		<xs:attribute name="alias" type="xs:string" />
		<xs:attribute name="type" type="xs:string" />
		<xs:attribute name="size" type="xs:integer" />
		<xs:attribute name="scale" type="xs:integer" />
   </xs:complexType>
   <xs:complexType name="MethodResultCollection">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element name="method-result" type="MethodResult" />
		</xs:choice>
   </xs:complexType>
   <xs:complexType name="MethodParameter">
		<xs:attribute name="name" type="xs:string" use="required" />
		<xs:attribute name="direction" type="xs:string" use="required" />
		<xs:attribute name="type" type="xs:string" use="required" />
		<xs:attribute name="size" type="xs:integer" />
		<xs:attribute name="scale" type="xs:integer" />
   </xs:complexType>
	<xs:complexType name="MethodParameterCollection">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element name="method-param" type="MethodParameter" />
		</xs:choice>
	</xs:complexType>
   <xs:complexType name="Method">
		<xs:sequence minOccurs="0" maxOccurs="1">
			<xs:element name="method-params" type="MethodParameterCollection" />
			<xs:element name="method-results" type="MethodResultCollection" />
			<xs:element name="method-filters" type="MethodFilterCollection" />
		</xs:sequence>
      <xs:attribute name="name" type="xs:string" />
      <xs:attribute name="type" type="MethodTypes" use="required" />
      <xs:attribute name="filter" type="xs:string" />
   </xs:complexType>
   <xs:complexType name="MethodCollection">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
         <xs:element name="method" type="Method" />
      </xs:choice>
   </xs:complexType>
   <xs:complexType name="Implement">
      <xs:attribute name="ref" type="xs:string" use="required" />
   </xs:complexType>
   <xs:complexType name="ImplementCollection">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
         <xs:element name="implement" type="Implement" />
      </xs:choice>
   </xs:complexType>
   <xs:complexType name="View">
      <xs:attribute name="name" type="xs:string" use="required" />
      <xs:attribute name="alias" type="xs:string" use="required" />
      <xs:attribute name="filename" type="xs:string" use="required" />
   </xs:complexType>
	<xs:complexType name="ViewCollection">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element name="view" type="View" />
		</xs:choice>
	</xs:complexType>
   <xs:complexType name="Collection">
      <xs:attribute name="name" type="xs:string" use="required" />
      <xs:attribute name="object" type="xs:string" use="required" />
      <xs:attribute name="binding" type="xs:string" use="required" />
      <xs:attribute name="alias" type="xs:string" use="required" />
   </xs:complexType>
	<xs:complexType name="CollectionCollection">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element name="collection" type="Collection" />
		</xs:choice>
	</xs:complexType>
   <xs:complexType name="Entity">
      <xs:all minOccurs="0" maxOccurs="1">
         <xs:element name="description" type="Description" minOccurs="0" maxOccurs="1" />
         <xs:element name="implements" type="ImplementCollection"  minOccurs="0" maxOccurs="1" />
         <xs:element name="fields" type="FieldCollection" minOccurs="0" maxOccurs="1" />
         <xs:element name="views" type="ViewCollection" minOccurs="0" maxOccurs="1" />
         <xs:element name="collections" type="CollectionCollection" minOccurs="0" maxOccurs="1" />
         <xs:element name="methods" type="MethodCollection" minOccurs="0" maxOccurs="1" />
      </xs:all>
      <xs:attribute name="name" type="xs:string" use="required" />
      <xs:attribute name="alias" type="xs:string" use="required" />
      <xs:attribute name="type" type="xs:string" />
      <xs:attribute name="filename" type="xs:string" use="required" />
      <xs:attribute name="namespace" type="xs:string" use="required" />
      <xs:attribute name="friendly-name" type="xs:string" />
      <xs:attribute name="logical-name" type="xs:string" />
      <xs:attribute name="filegroup" type="xs:string" />
   </xs:complexType>
   <xs:complexType name="EntityCollection">
      <xs:sequence minOccurs="0" maxOccurs="unbounded">
         <xs:element name="object" type="Entity" />
      </xs:sequence>
   </xs:complexType>
   <xs:complexType name="Project">
      <xs:all minOccurs="0" maxOccurs="1">
         <xs:element name="description" type="Description" />
         <xs:element name="objects" type="EntityCollection" />
      </xs:all>
      <xs:attribute name="name" type="xs:string" use="required" />
      <xs:attribute name="owner" type="xs:string" use="required" />
      <xs:attribute name="user" type="xs:string" use="required" />
      <xs:attribute name="defaultnamespace" type="xs:string" />
      <xs:attribute name="namespaceprefix" type="xs:string" />
      <xs:attribute name="namespaceuri" type="xs:string" />
      <xs:attribute name="businessconcept" type="xs:string" />
   </xs:complexType>
   <xs:complexType name="DataColumn">
      <xs:all>
         <xs:element name="description" type="Description" minOccurs="0" maxOccurs="1" />
         <xs:element name="indexes" type="IndexCollection" minOccurs="0" maxOccurs="1" />
      </xs:all>
      <xs:attribute name="name" type="xs:string" use="required" />
      <xs:attribute name="alias" type="xs:string" />
      <xs:attribute name="size" type="xs:integer" />
      <xs:attribute name="scale" type="xs:integer" />
      <xs:attribute name="type" type="xs:string" />
      <xs:attribute name="autogenerate" type="xs:boolean" default="false" />
      <xs:attribute name="required" type="xs:boolean" default="false" />
      <xs:attribute name="readonly" type="xs:boolean" default="false" />
      <xs:attribute name="tableonly" type="xs:boolean" default="false" />
      <xs:attribute name="friendly-name" type="xs:string" />
      <xs:attribute name="logical-name" type="xs:string" />
      <xs:attribute name="default" type="xs:string" />
   </xs:complexType>
	<xs:complexType name="DataColumns">
		<xs:sequence minOccurs="0" maxOccurs="unbounded">
			<xs:element name="column" type="DataColumn" />
		</xs:sequence>
	</xs:complexType>
   <xs:complexType name="DataTable">
		<xs:all minOccurs="0" maxOccurs="1">
			<xs:element name="columns" type="DataColumns" />
		</xs:all>
		<xs:attribute name="name" type="xs:string" />
		<xs:attribute name="ref" type="xs:string" />
		<xs:attribute name="type" type="xs:string" />
   </xs:complexType>
   <xs:complexType name="DataTables">
		<xs:sequence minOccurs="0" maxOccurs="unbounded">
			<xs:element name="datatable" type="DataTable" />
		</xs:sequence>
   </xs:complexType>
   <xs:complexType name="RelationReference">
		<xs:attribute name="name" type="xs:string" />
		<xs:attribute name="ref" type="xs:string" />
		<xs:attribute name="cardinality" type="xs:string" />
   </xs:complexType>
   <xs:complexType name="Relation">
		<xs:all minOccurs="1" maxOccurs="1">
			<xs:element name="source" type="RelationReference" />
			<xs:element name="target" type="RelationReference" />
		</xs:all>
		<xs:attribute name="name" type="xs:string" />
   </xs:complexType>
   <xs:complexType name="Relations">
		<xs:sequence minOccurs="0" maxOccurs="unbounded">
			<xs:element name="relation" type="Relation" />
		</xs:sequence>
   </xs:complexType>
   <xs:complexType name="BusinessView">
		<xs:all minOccurs="0" maxOccurs="1">
			<xs:element name="datatables" type="DataTables" />
			<xs:element name="relations" type="Relations" />
		</xs:all>
		<xs:attribute name="name" type="xs:string" use="required" />
		<xs:attribute name="context" type="xs:string" use="required" />
   </xs:complexType>
   <xs:complexType name="BusinessViews">
		<xs:sequence minOccurs="0" maxOccurs="unbounded">
			<xs:element name="businessview" type="BusinessView" />
		</xs:sequence>
   </xs:complexType>
   <xs:element name="project" type="Project" />
</xs:schema>
